feat: support assets api 0.3#114
Conversation
Signed-off-by: Richard Sandoval <rsandovaldev@gmail.com>
17a24ec to
8545fc6
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Python Assets client to support frequenz-api-assets / Assets API 0.3.x by adding new list RPC client methods plus the corresponding domain models, protobuf conversions, and test cases.
Changes:
- Added new client methods for listing gridpools, gridpool energy schedules, market topology relations, microgrids, and microgrid sensors.
- Introduced new domain model types (e.g.,
Gridpool,Interval,MarketTopologyRelation,Sensor, etc.) and protobuf conversion helpers. - Expanded
list_microgrid_electrical_components()withcomponent_idsandcategoriesfilters, and added/extended test coverage + release notes.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_client.py | Adds parametrized tests for newly supported list RPCs. |
| tests/client_test_cases/list_microgrids/success_case.py | Success test case data for list_microgrids(). |
| tests/client_test_cases/list_microgrids/error_case.py | Permission-denied test case for list_microgrids(). |
| tests/client_test_cases/list_microgrids/empty_case.py | Empty-response test case for list_microgrids(). |
| tests/client_test_cases/list_microgrid_sensors/success_case.py | Success test case data for list_microgrid_sensors(). |
| tests/client_test_cases/list_microgrid_sensors/error_case.py | Permission-denied test case for list_microgrid_sensors(). |
| tests/client_test_cases/list_microgrid_sensors/empty_case.py | Empty-response test case for list_microgrid_sensors(). |
| tests/client_test_cases/list_microgrid_electrical_components/filtered_case.py | Adds a filtered listing test case for electrical components. |
| tests/client_test_cases/list_microgrid_electrical_component_connections/filtered_case.py | Adds a filtered listing test case for component connections. |
| tests/client_test_cases/list_market_topology_relations/success_case.py | Success test case data for list_market_topology_relations(). |
| tests/client_test_cases/list_market_topology_relations/error_case.py | Permission-denied test case for list_market_topology_relations(). |
| tests/client_test_cases/list_market_topology_relations/empty_case.py | Empty-response test case for list_market_topology_relations(). |
| tests/client_test_cases/list_gridpools/success_case.py | Success test case data for list_gridpools(). |
| tests/client_test_cases/list_gridpools/error_case.py | Permission-denied test case for list_gridpools(). |
| tests/client_test_cases/list_gridpools/empty_case.py | Empty-response test case for list_gridpools(). |
| tests/client_test_cases/list_gridpool_energy_schedules/success_case.py | Success test case data for list_gridpool_energy_schedules(). |
| tests/client_test_cases/list_gridpool_energy_schedules/error_case.py | Permission-denied test case for list_gridpool_energy_schedules(). |
| tests/client_test_cases/list_gridpool_energy_schedules/empty_case.py | Empty-response test case for list_gridpool_energy_schedules(). |
| src/frequenz/client/assets/electrical_component/_electrical_component_proto.py | Switches enum conversion helper to enum_from_proto(). |
| src/frequenz/client/assets/_sensor.py | Adds Sensor domain model. |
| src/frequenz/client/assets/_sensor_proto.py | Adds protobuf → domain conversion for sensors. |
| src/frequenz/client/assets/_microgrid_proto.py | Switches microgrid enum conversion helper to enum_from_proto(). |
| src/frequenz/client/assets/_market_topology.py | Adds market topology domain models/enums. |
| src/frequenz/client/assets/_market_topology_proto.py | Adds protobuf → domain conversion for market topology. |
| src/frequenz/client/assets/_market_location.py | Adds market location domain models/enums. |
| src/frequenz/client/assets/_market_location_proto.py | Adds protobuf → domain conversion for market locations + ID value helper. |
| src/frequenz/client/assets/_interval.py | Adds Interval domain type with validation. |
| src/frequenz/client/assets/_interval_proto.py | Adds Interval ↔ protobuf conversion. |
| src/frequenz/client/assets/_gridpool.py | Adds Gridpool domain model. |
| src/frequenz/client/assets/_gridpool_proto.py | Adds protobuf → domain conversion for gridpools. |
| src/frequenz/client/assets/_gridpool_energy_schedule.py | Adds gridpool energy schedule domain models/enums. |
| src/frequenz/client/assets/_gridpool_energy_schedule_proto.py | Adds protobuf → domain conversion for gridpool energy schedules. |
| src/frequenz/client/assets/_delivery_area_proto.py | Switches enum conversion helper and adds delivery_area_to_proto(). |
| src/frequenz/client/assets/_client.py | Implements new list methods + adds filters to electrical component listing. |
| src/frequenz/client/assets/_balancing_group.py | Adds BalancingGroup domain model. |
| src/frequenz/client/assets/_balancing_group_proto.py | Adds protobuf → domain conversion for balancing groups. |
| src/frequenz/client/assets/init.py | Exports newly added domain types and enums. |
| RELEASE_NOTES.md | Documents the newly added client methods and filters. |
| pyproject.toml | Bumps dependency versions to match the new API support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
phillip-wenig-frequenz
left a comment
There was a problem hiding this comment.
direkt mapping from protobuf to code, and copilot didn't find anything wrong. It also looks good to me. LGTM
llucax
left a comment
There was a problem hiding this comment.
Oh, damn, this is a blow to my work on client-common. I guess it is urgent as usual, but if it is not, it would be better to skip adding all common wrappers here and add them to client-common instead. I'm still polishing the approach on error handling, so there might be some instability still, but by now I think it should be mostly clear.
For how things are currently in this client, I gave this a very quick look and LGTM, but not approving because I'm not familiar with all the gridpool stuff.
No description provided.